/* 编辑器页面 - 简约三栏布局 */
.editor-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f5f5f5;
  overflow: hidden;
}

/* 顶部工具栏 */
.editor-header {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}

.header-right {
  display: flex;
  gap: 12px;
}

/* 主内容区 - 三栏布局 */
.editor-main {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr 400px;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

/* 侧边栏通用样式 */
.editor-sidebar {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-sidebar.left {
  border-right: 1px solid #e8e8e8;
}

.editor-sidebar.right {
  border-left: 1px solid #e8e8e8;
  background: #fafafa;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 16px;
  padding: 20px 16px 12px 16px;
  border-bottom: 2px solid #e8e8e8;
  flex-shrink: 0;
}

/* 模板列表 */
.template-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 0 16px 20px 16px;
  flex: 1;
}

.template-card {
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  border-radius: 8px;
}

.template-card:hover {
  border-color: #91d5ff;
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.15);
}

.template-card.active {
  border-color: #1890ff;
  box-shadow: 0 4px 16px rgba(24, 144, 255, 0.25);
  background: #e6f7ff;
}

.template-preview {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px 6px 0 0;
}

.template-card .ant-card-meta-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

.template-card .ant-card-meta-description {
  font-size: 12px;
  color: #8c8c8c;
}

/* 中间编辑区 */
.editor-content {
  background: #ffffff;
  padding: 24px;
  overflow-y: auto;
  min-height: 0;
}

.content-section {
  margin-bottom: 32px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 12px;
}

.content-textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #d9d9d9;
  padding: 16px;
  font-size: 15px;
  line-height: 1.8;
  resize: vertical;
  transition: all 0.3s ease;
}

.content-textarea:hover {
  border-color: #40a9ff;
}

.content-textarea:focus {
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
  outline: none;
}

/* 图片上传区 */
.upload-tip {
  margin-top: 8px;
  font-size: 13px;
  color: #8c8c8c;
}

/* 预览区 */
.preview-container {
  background: #ffffff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow-y: auto;
  flex: 1;
  margin: 0 16px 20px 16px;
  min-height: 0;
}

.preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #8c8c8c;
}

.preview-loading p {
  margin-top: 16px;
  font-size: 14px;
}

.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: #bfbfbf;
}

.preview-empty p {
  margin-top: 16px;
  font-size: 14px;
  color: #8c8c8c;
}

.preview-content {
  /* 预览内容的样式由生成的HTML控制 */
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.preview-content img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 响应式设计 */
@media (max-width: 1400px) {
  .editor-main {
    grid-template-columns: 260px 1fr 360px;
  }
}

@media (max-width: 1200px) {
  .editor-main {
    grid-template-columns: 1fr;
    height: auto;
  }

  .editor-sidebar {
    display: none;
  }

  .editor-content {
    padding: 20px 16px;
  }

  /* 移动端显示简化版 */
  .template-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
  }
}

/* 滚动条样式 */
.template-list::-webkit-scrollbar,
.editor-content::-webkit-scrollbar,
.preview-container::-webkit-scrollbar {
  width: 6px;
}

.template-list::-webkit-scrollbar-thumb,
.editor-content::-webkit-scrollbar-thumb,
.preview-container::-webkit-scrollbar-thumb {
  background: #d9d9d9;
  border-radius: 3px;
}

.template-list::-webkit-scrollbar-thumb:hover,
.editor-content::-webkit-scrollbar-thumb:hover,
.preview-container::-webkit-scrollbar-thumb:hover {
  background: #bfbfbf;
}

.template-list::-webkit-scrollbar-track,
.editor-content::-webkit-scrollbar-track,
.preview-container::-webkit-scrollbar-track {
  background: transparent;
}

/* Ant Design Upload组件自定义样式 */
.ant-upload.ant-upload-select-picture-card {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  border: 2px dashed #d9d9d9;
  transition: all 0.3s ease;
}

.ant-upload.ant-upload-select-picture-card:hover {
  border-color: #1890ff;
}

/* 动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.editor-page {
  animation: fadeIn 0.5s ease;
}

